import { BaseEntity } from '../../base/entity/base';
import { Column, Entity, Index } from 'typeorm';

/**
 * 客户跟进
 */
@Entity('customer_follow')
export class CustomerFollowEntity extends BaseEntity {
  @Index()
  @Column({ comment: '客户ID' })
  customerId: number;

  @Column({ comment: '类型', dict: ['电话', '邮件', '拜访'], default: 0 })
  type: number;

  @Column({ comment: '内容', type: 'text' })
  content: string;

  @Column({ comment: '时间', type: 'varchar' })
  time: Date;

  @Index()
  @Column({ comment: '人员', nullable: true })
  userId: number;

  @Column({ comment: '附件', type: 'json', nullable: true })
  fileIds: number[];

  @Column({ comment: '下次跟进时间', type: 'varchar', nullable: true })
  nextFollowTime: Date;

  @Column({
    comment: '跟进结果',
    dict: ['待继续', '已成交', '无效'],
    default: 0,
  })
  result: number;
}
